//
//  HHPMediatorManager+WebView.m
//  HHPLiveVideo
//
//  Created by 韩红坡 on 2017/2/21.
//  Copyright © 2017年 韩红坡. All rights reserved.
//

#import "HHPMediatorManager+WebView.h"

NSString * const kMediatorTargetWebView= @"WebView";

NSString * const kMediatorActionPushWebViewControllerWithDictionary = @"pushWebViewControllerWithDictionary";

@implementation HHPMediatorManager (WebView)

- (void)mediator_pushWebViewControllerWithType:(WebViewType)type
{
    
    NSString *urlString = @"";
    NSString *title = @"";
    
    switch (type) {
        case WebViewTypeMaterialList:
        {
//            urlString = [pageArray[2] name];
//            title = surveyData;
        }
            break;
            
        default:
            break;
    }
    
    [self mediator_pushWebViewControllerWithUrlString:urlString withTitle:title];
}

- (void)mediator_pushWebViewControllerWithUrlString:(NSString *)urlString withTitle:(NSString *)title
{
    NSDictionary *dict = @{@"urlString":urlString, @"title":title};
    
    [self nativeCallModuleWithTarget:kMediatorTargetWebView action:kMediatorActionPushWebViewControllerWithDictionary params:dict];
}

- (void)mediator_pushWebViewControllerWithAbsoluteUrlString:(NSString *)urlString withTitle:(NSString *)title
{
    NSDictionary *dict = @{@"absoluteUrlString":urlString, @"title":title};
    
    [self nativeCallModuleWithTarget:kMediatorTargetWebView action:kMediatorActionPushWebViewControllerWithDictionary params:dict];
}

@end
